package game.engine.base.test

import android.app.Activity
import com.daidai.base.BaseActivity
import com.daidai.spinner.R
import game.engine.base.Director
import game.engine.base.IGameApp
import game.engine.base.RenderView

 abstract class GameActivity : BaseActivity(), IGameApp {

    //--------------------------
    // properties
    lateinit var renderView:RenderView
    lateinit var director: Director

    //--------------------------
    // igameapp
    override  val activity: Activity
        get() = this

    //--------------------------
    // activity
    override fun getContentViewResId(): Int = R.layout.test_game

    override fun initView() {
        renderView = findViewById(R.id.renderView)

        // 创建 director
        director = Director(this,renderView)
    }

    override fun initData() {
    }


     override fun onPause() {
         super.onPause()
         director.pause()
     }

     override fun onResume() {
         super.onResume()
         director.resume()
     }

     override fun onDestroy() {
         super.onDestroy()
         director.stopEngine()
     }
}